<!DOCTYPE html>
<html lang='zh-CN'>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
<style>

</style>
</head>
<body>

<script>
    
    const arr = Array.from({length:5}).map(()=>{
        const obj = {}
        return obj
    }) 
    // console.log(arr)
    const arr1 = [1,2,3]
    for(const key of arr1) {
        console.log(key)
    }
    const arr2 = [{a:1,b:2},{a:3,b:4}]
    for (const {a,b} of arr2) {
        console.log(a,b)
    }
    const arr3 = [[6, 7], [9, 10]]
    for(const [a,b] of arr3) {
        console.log(a,b)
    }
    // 3. Object.entries
    const obj = {a:1,b:2}
    const keys = Object.keys(obj)
        console.log(keys)
        const values = Object.values(obj)
        console.log(values)
        const entries = Object.entries(obj)
        console.log(entries)
        for (let key in obj) {
            console.log(key, obj[key])
        }
        for (const [key, value] of entries) {
            console.log(key, value)
        }
</script>
</body>
</html>